package com.dragon.refect.constructor;

/**
 * @author dragon
 * @since 2019/12/1
 */
public class Apple {

    private String name;

    private Double price;

    static class Inner {

        void a() {
            System.out.println("inner a()");
        }
    }

    class Inner2 {

    }

    public Apple(String name, Double price) {
        this.name = name;
        this.price = price;
    }

    Apple(String name) {
        this.name = name;
    }

    public Apple(Double price) {
        Inner inner = new Inner(){
            @Override
            public void a() {
                System.out.println("anonymous inner a() ");
            }
        };

        this.price = price;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }
}
